package forJava;

public class Cat {

    private String name;
    private String color;
    private float weight;

    public Cat(String name, String color, float weight) {

        this.name = name;
        this.color = color;
        this.weight = weight;
    }

    public Cat() {

    }

    public String getName() {

        return name;
    }

    public void setName(String name) {

        this.name = name;
    }

    public String getColor() {

        return color;
    }

    public void setColor(String color) {

        this.color = color;
    }

    public float getWeight() {

        return weight;
    }

    public void setWeight(float weight) {

        this.weight = weight;
    }

    public void sayHello() {

        System.out.printf("大家好,我是%s\n", this.name);
    }

    @Override
    public String toString() {

        return "Cat{" +
                "name='" + name + '\'' +
                ", color='" + color + '\'' +
                ", weight='" + weight + '\'' +
                ", hashCode='" + hashCode() + '\'' +
                '}';
    }

}
